package org.zjvis.datascience.common.dto.dataset;

import lombok.Data;

/**
 * @description 数据集名称类型DTO
 * @date 2021-12-24
 */
@Data
public class DatasetNameTypeDTO {

    private Long id;

    private String name;

    private String type;

    private String tableName;

    public DatasetNameTypeDTO(Long datasetId, String datasetName, String type) {
        this.id = datasetId;
        this.name = datasetName;
        this.type = type;
    }

    public DatasetNameTypeDTO(Long datasetId, String datasetName, String type, String gisConfig) {
        this.id = datasetId;
        this.name = datasetName;
        if (null!=gisConfig && !gisConfig.isEmpty()){
            if (type.equals("gis")){
                this.type = "gis-csv";
            }else if(type.contains("-")){
                this.type = type;
            }else {
                this.type = "gis-" + type;
            }
        }else {
            this.type = type;
        }
    }

}
